package request

type ArticleListRequest struct {
	Page     int    `json:"page" binding:"required" label:"页码"`
	PageSize int    `json:"page_size" binding:"required" label:"每页数量"`
	Title    string `json:"title" label:"标题"`
	Desc     string `json:"desc" label:"描述"`
}

func (a ArticleListRequest) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"Page.required":     "页码不能为空",
		"PageSize.required": "每页数量不能为空",
	}
}

type ArticleAddRequest struct {
	Title   string `json:"title" binding:"required" label:"标题"`
	Content string `json:"content" binding:"required" label:"内容"`
	//desc
	Desc string `json:"desc"  label:"描述"`
}

func (a ArticleAddRequest) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"Title.required":   "标题不能为空",
		"Content.required": "内容不能为空",
	}
}

type ArticleUpdateRequest struct {
	Id      int    `json:"id" binding:"required" label:"id"`
	Title   string `json:"title" binding:"required" label:"标题"`
	Content string `json:"content" binding:"required" label:"内容"`
	Img     string `json:"img" binding:"required" label:"图片"`
	Status  int    `json:"status" binding:"required" label:"状态"`
	//文章类型
	Type string `json:"type" binding:"required" label:"文章类型"`

	//关联的游戏id
	GameId string `json:"game_id" binding:"required" label:"游戏id"`
}

func (a ArticleUpdateRequest) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"Id.required":      "id不能为空",
		"Title.required":   "标题不能为空",
		"Content.required": "内容不能为空",
	}
}

type ArticleDeleteRequest struct {
	Id int `json:"id" binding:"required" label:"id"`
}

func (a ArticleDeleteRequest) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"Id.required": "id不能为空",
	}
}

type ArticleDetailRequest struct {
	Id uint `json:"id" binding:"required" label:"id"`
}

func (a ArticleDetailRequest) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"Id.required": "id不能为空",
	}
}

type ArticleRandomRequest struct {
	//获取的数量
	Shuliang int `json:"shuliang" binding:"required" label:"获取的数量"`
	//文章的类型
	Type string `json:"type" binding:"required" label:"文章的类型"`
}

type ArticleCommentAddRequest struct {
	ArticleId uint   `json:"article_id"  label:"文章id"`
	Content   string `json:"content"  label:"内容"`
	ParentId  uint   `json:"parent_id"  label:"父级id"`
	UserId    uint   `json:"user_id" label:"用户id"`
}

func (a ArticleCommentAddRequest) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		// "ArticleId.required": "文章id不能为空",
		// "Content.required":   "内容不能为空",
		// "ParentId.required":  "父级id不能为空",
		// "UserId.required":    "用户id不能为空",
	}
}

type ArticleCommentUpdateRequest struct {
	Id        uint   `json:"id" binding:"required" label:"id"`
	ArticleId uint   `json:"article_id" binding:"required" label:"文章id"`
	Content   string `json:"content" binding:"required" label:"内容"`
	ParentId  uint   `json:"parent_id" binding:"required" label:"父级id"`
	UserId    uint   `json:"user_id" binding:"required" label:"用户id"`
}

func (a ArticleCommentUpdateRequest) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"Id.required":        "id不能为空",
		"ArticleId.required": "文章id不能为空",
		"Content.required":   "内容不能为空",
		"ParentId.required":  "父级id不能为空",
		"UserId.required":    "用户id不能为空",
	}
}

type ArticleCommentDeleteRequest struct {
	Id uint `json:"id" binding:"required" label:"id"`
}
